<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>data_stream - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="data_stream"></a>data_stream</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "colspan=5>virtual class data_stream #(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> bit,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>WIDTH</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>DEGREE</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 2</td></tr><tr><td class="PAfterParameters  prettyprint "colspan=5>) extends dynamic_array #( T[WIDTH-1:0] )</td></tr></table></td></tr></table></blockquote><p>A parameterized class that manages a stream of packed arrays.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>T</td><td class=CDLDescription><span class="optional">optional</span> The type of the packed array of a data stream.&nbsp; The <b>T</b> must be the single bit data types (<b>bit</b>, <b>logic</b>, or <b>reg</b>).&nbsp;  The default type is <b>bit</b>.</td></tr><tr><td class=CDLEntry>WIDTH</td><td class=CDLDescription><span class="optional">optional</span> The width of the packed array.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>DEGREE</td><td class=CDLDescription><span class="optional">optional</span> The degree of an LFSR polynomial.&nbsp; This parameter is used only if <b>scramble</b> function is used.&nbsp; The default is 2.</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#data_stream" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">data_stream</a></td><td class=SDescription>A parameterized class that manages a stream of packed arrays.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#data_stream.Common_Arguments" >Common Arguments</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#data_stream.Types" >Types</a></td><td class=SDescription></td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#data_stream.pa_type" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">pa_type</a></td><td class=SDescription>The shorthand of the packed array of type <b>T</b>.</td></tr><tr class="SType SIndent2"><td class=SEntry><a href="#data_stream.ds_type" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">ds_type</a></td><td class=SDescription>The data stream type. </td></tr><tr class="SType SIndent2 SMarked"><td class=SEntry><a href="#data_stream.bs_type" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">bs_type</a></td><td class=SDescription>The bit stream type. </td></tr><tr class="SType SIndent2"><td class=SEntry><a href="#data_stream.lfsr_type" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">lfsr_type</a></td><td class=SDescription>The linear feedback shift register (LFSR) type. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#data_stream.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#data_stream.to_bit_stream" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">to_bit_stream</a></td><td class=SDescription><span class="static">static</span> Serializes a data stream of type <b>T</b> to a bit stream of the same type.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#data_stream.make_divisible" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">make_divisible</a></td><td class=SDescription><span class="static">static</span> Makes the data stream divisible by the specified number by padding data.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#data_stream.sequential" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">sequential</a></td><td class=SDescription><span class="static">static</span> Returns a new data stream with the elements whose values are initialized with sequential values.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#data_stream.constant" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">constant</a></td><td class=SDescription><span class="static">static</span> Returns a new data stream with the elements whose values are initiazlized with the specified constant.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#data_stream.random" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">random</a></td><td class=SDescription><span class="static">static</span> Returns a new data stream with the elements whose values are randomized.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#data_stream.scramble" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">scramble</a></td><td class=SDescription><span class="static">static</span> Returns a scrambled data stream.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#data_stream.to_string" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">to_string</a></td><td class=SDescription><span class="static">static</span> Converts a data stream to the form of a string.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#data_stream.to_string_with_en" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">to_string_with_en</a></td><td class=SDescription><span class="static">static</span> Converts a data stream with corresponding data enables to the form of a string.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="data_stream.Common_Arguments"></a>Common Arguments</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>from_index</td><td class=CDLDescription>The index of the first element of a data stream to be processed.&nbsp;  If negative, the index counts from the last.&nbsp; For example, if <b>from_index</b> is -9, a function starts at the ninth element (inclusive) from the last.&nbsp;  The default is 0 (starts at the first element).</td></tr><tr><td class=CDLEntry>to_index</td><td class=CDLDescription>The index of the last element of a data stream to be processed.&nbsp;  If negative, the index counts from the last.&nbsp;  For example, if <b>to_index</b> is -3, a function ends at the third element (inclusive) from the last.&nbsp;  The default is -1 (ends at the last element).</td></tr></table></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="data_stream.Types"></a>Types</h3></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="data_stream.pa_type"></a>pa_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T [WIDTH-1:0] pa_type</td></tr></table></blockquote><p>The shorthand of the packed array of type <b>T</b>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="data_stream.ds_type"></a>ds_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef pa_type ds_type[]</td></tr></table></blockquote><p>The data stream type.&nbsp; The shorthand of the dynamic array of <a href="#data_stream.pa_type" class=LType id=link14 onMouseOver="ShowTip(event, 'tt2', 'link14')" onMouseOut="HideTip('tt2')">pa_type</a>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="data_stream.bs_type"></a>bs_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T bs_type[]</td></tr></table></blockquote><p>The bit stream type.&nbsp; The shorthand of the dynamic array of type <b>T</b>.</p></div></div></div>

<div class="CType"><div class=CTopic><h3 class=CTitle><a name="data_stream.lfsr_type"></a>lfsr_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef scrambler#(</td><td class="PParameter  prettyprint " nowrap>T,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>DEGREE</td><td class="PAfterParameters  prettyprint "nowrap>)::lfsr_type lfsr_type</td></tr></table></td></tr></table></blockquote><p>The linear feedback shift register (LFSR) type.&nbsp; The shorthand of the <b>lfsr_type</b> defined in the <a href="cl_scrambler-svh.html#scrambler" class=LClass id=link15 onMouseOver="ShowTip(event, 'tt14', 'link15')" onMouseOut="HideTip('tt14')">scrambler</a> class.</p></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="data_stream.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.to_bit_stream"></a>to_bit_stream</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bs_type to_bit_stream(</td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>msb_first</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Serializes a data stream of type <b>T</b> to a bit stream of the same type.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ds</td><td class=CDLDescription>An input data stream.</td></tr><tr><td class=CDLEntry>msb_first</td><td class=CDLDescription><span class="optional">optional</span> If 1, converts <b>ds</b> from the most significant bit to the least significant bit.&nbsp; If 0, converts <b>ds</b> from the least significant bit to the most signicant bit.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>from_index</td><td class=CDLDescription><span class="optional">optional</span> The index of the first element of <b>ds</b> to convert.&nbsp; See <a href="#data_stream.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>to_index</td><td class=CDLDescription><span class="optional">optional</span> The index of the last element of <b>ds</b> to convert.&nbsp; See <a href="#data_stream.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is -1.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> bit stream serialized from <b>ds</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds[] = new[2]( '{ 8'h0F, 8'hAA } );
bit bs0[] = new[16]( '{ 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0 } );
bit bs1[] = new[16]( '{ 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1 } );

assert( data_stream#(bit,8)::to_bit_stream( ds                  ) == bs0 );
assert( data_stream#(bit,8)::to_bit_stream( ds, .msb_first( 0 ) ) == bs1 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.make_divisible"></a>make_divisible</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type make_divisible(</td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>divisible_by</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>padding</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Makes the data stream divisible by the specified number by padding data.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ds</td><td class=CDLDescription>An input data stream.</td></tr><tr><td class=CDLEntry>divisible_by</td><td class=CDLDescription><span class="optional">optional</span> The output data stream is divisible by this number.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>padding</td><td class=CDLDescription><span class="optional">optional</span> Padding data.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> data stream made divisible by <b>divisible_by</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds[]       = new[4]( '{ 8'h00, 8'h01, 8'h02, 8'h03               } );
bit[7:0] expected[] = new[6]( '{ 8'h00, 8'h01, 8'h02, 8'h03, 8'hFF, 8'hFF } );

assert( data_stream#(bit,8)::make_divisible( ds, .divisible_by( 3 ), .padding( 8'hFF ) ) == expected );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.sequential"></a>sequential</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type sequential(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>init_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>step</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>randomize_init_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a new data stream with the elements whose values are initialized with sequential values.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>length</td><td class=CDLDescription>The length of the output data stream.</td></tr><tr><td class=CDLEntry>init_value</td><td class=CDLDescription><span class="optional">optional</span> The value of the first element.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>step</td><td class=CDLDescription><span class="optional">optional</span> The value difference between two adjacent elements.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>randomize_init_value</td><td class=CDLDescription><span class="optional">optional</span> If 1, the value of the first element is randomized (the <b>init_value</b> argument is ignored).&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> data stream with the elements whose values are initialized with sequential values.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds0[] = new[8]( '{ 8'hFE, 8'hFF, 8'h00, 8'h01, 8'h02, 8'h03, 8'h04, 8'h05 } );
bit[7:0] ds1[] = new[8]( '{ 8'hFE, 8'h00, 8'h02, 8'h04, 8'h06, 8'h08, 8'h0A, 8'h0C } );
bit[7:0] ds2[] = new[8]( '{ 8'hFE, 8'hFD, 8'hFC, 8'hFB, 8'hFA, 8'hF9, 8'hF8, 8'hF7 } );

assert( data_stream#(bit,8)::sequential( .length( 8 ), .init_value( 8'hFE )              ) == ds0 );
assert( data_stream#(bit,8)::sequential( .length( 8 ), .init_value( 8'hFE ), .step(  2 ) ) == ds1 );
assert( data_stream#(bit,8)::sequential( .length( 8 ), .init_value( 8'hFE ), .step( -1 ) ) == ds2 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.constant"></a>constant</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type constant(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>randomize_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a new data stream with the elements whose values are initiazlized with the specified constant.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>length</td><td class=CDLDescription>The length of the output data stream.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription><span class="optional">optional</span> The value of the elements.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>randomize_value</td><td class=CDLDescription><span class="optional">optional</span> If 1, the value of the elements is randomized (the <b>value</b> argument is ignored).&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> data stream with the elements whose values are initialized with <b>value</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] expected[] = new[8]( '{ 8'hAB, 8'hAB, 8'hAB, 8'hAB, 8'hAB, 8'hAB, 8'hAB, 8'hAB } );
assert( data_stream#(bit,8)::constant( .length( 8 ), .value( 8'hAB ) ) == expected );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.random"></a>random</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type random(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a new data stream with the elements whose values are randomized.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>length</td><td class=CDLDescription>The length of the output data stream.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> data stream with the elements whose values are randomized.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds[];
ds = data_stream#(bit,8)::random( .length( 16 ) );
$display( data_stream#(bit,8)::to_string( ds, .group( 1 ) ) );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.scramble"></a>scramble</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type scramble(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>scrambler#(T,DEGREE)&nbsp;</td><td class="PParameter  prettyprint " nowrap>scrblr,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>lfsr_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>lfsr,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>msb_first</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a scrambled data stream.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ds</td><td class=CDLDescription>An input data stream.</td></tr><tr><td class=CDLEntry>scrblr</td><td class=CDLDescription>A scrambler to use.</td></tr><tr><td class=CDLEntry>lfsr</td><td class=CDLDescription>The value of a linear feedback shift register (LFSR), which can be used as the seed of the next call of this function.&nbsp; The initial value should be all ones.</td></tr><tr><td class=CDLEntry>msb_first</td><td class=CDLDescription>If 1, scrambles <b>ds</b> from the most significant bit.&nbsp;  If 0, scrambles <b>ds</b> from the least significant bit to the most signicant bit.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>little_endian</td><td class=CDLDescription><span class="optional">optional</span> If 1, each data-stream item is scrambled from LSBs.&nbsp; If 0, each data stream item is scrambled from MSBs.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A <u>new</u> data stream scrambled by <b>scrblr</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds[] = new[8]( '{ 8'h00, 8'h01, 8'h02, 8'h03, 8'h04, 8'h05, 8'h06, 8'h07 } );
bit[7:0] scrambled[];
scrambler_16#(bit) scrblr = new;
bit[15:0] lfsr = '1;

scrambled = data_stream#(bit,8,16)::scramble( ds, scrblr, lfsr ); // DEGREE=16
$display( data_stream#(bit,8)::to_string( scrambled, .group( 1 ) ) );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.to_string"></a>to_string</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>left_to_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>group</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>group_separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_head</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_tail</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>abbrev</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;... &quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a data stream to the form of a string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ds</td><td class=CDLDescription>An input data stream.</td></tr><tr><td class=CDLEntry>left_to_right</td><td class=CDLDescription><span class="optional">optional</span> If 1, the item at index 0 of the data stream is placed on the left of the output string.&nbsp; If 0, the item at index 0 of the data stream is placed on the right of the output string.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>group</td><td class=CDLDescription><span class="optional">optional</span> The number of items put together in a group.&nbsp; If 0, no groups are created.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>group_separator</td><td class=CDLDescription><span class="optional">optional</span> A string to separate two groups if <b>group</b> is not 0.&nbsp; The default is a single space (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>num_head</td><td class=CDLDescription><span class="optional">optional</span> The number of first items in the data stream converted to a string.&nbsp; If specified, <b>ds[0]</b> to <b>ds[num_head-1]</b> are converted.&nbsp; If not specified (or -1), all items in the data stream are converted.</td></tr><tr><td class=CDLEntry>num_tail</td><td class=CDLDescription><span class="optional">optional</span> The number of last items in the data stream converted to a string.&nbsp; If specified, <b>ds[ds.size()-num_tail]</b> to <b>ds[ds.size()-1]</b> are converted.&nbsp; If not specified (or -1), all items in the data stream are converted.</td></tr><tr><td class=CDLEntry>abbrev</td><td class=CDLDescription><span class="optional">optional</span> A string to indicate the abbreviation of the items in the data stream.&nbsp; The <b>abbrev</b> is used only if all items are not converted to a string.&nbsp; The default is three periods followed by a space (&ldquo;...&nbsp; &ldquo;).</td></tr></table><h4 class=CHeading>Returns</h4><p>A string representing <b>ds</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[15:0] ds16[] = new[7]( '{ 16'h0123, 16'h4567, 16'h89ab, 16'hcdef, 16'h0000, 16'h0001, 16'h1000 } );
assert( data_stream#(bit,16)::to_string( ds16 )
  == &quot;0123456789abcdef000000011000&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .left_to_right( 0 ) )
  == &quot;100000010000cdef89ab45670123&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 1 ) )
  == &quot;0123 4567 89ab cdef 0000 0001 1000&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 2 ) )
  == &quot;01234567 89abcdef 00000001 1000&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 1 ), .left_to_right( 0 ) )
  == &quot;1000 0001 0000 cdef 89ab 4567 0123&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 2 ), .left_to_right( 0 ) )
  == &quot;10000001 0000cdef 89ab4567 0123&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 1 ), .num_head( 2 ), .num_tail( 0 ) )
  == &quot;0123 4567 ... &quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 1 ), .num_head( 0 ), .num_tail( 2 ) )
  == &quot;... 0001 1000&quot; );
assert( data_stream#(bit,16)::to_string( ds16, .group( 1 ), .num_head( 2 ), .num_tail( 2 ) )
  == &quot;0123 4567 ... 0001 1000&quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="data_stream.to_string_with_en"></a>to_string_with_en</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string_with_en(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>enables[],</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>disabled_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;-&quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>left_to_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>group</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>group_separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_head</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_tail</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>abbrev</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;...&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Converts a data stream with corresponding data enables to the form of a string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>ds</td><td class=CDLDescription>An input data stream.</td></tr><tr><td class=CDLEntry>enables</td><td class=CDLDescription>The dynamic array of data enables corresponding to the data in <b>ds</b>.&nbsp; The size of <b>enables</b> should be the same as the size of <b>ds</b>.&nbsp; If the size of <b>enables</b> is larger than the size of <b>ds</b>, the excess data enables are ignored.&nbsp; If the size of <b>enables</b> is smaller than the size of <b>ds</b>, the data without enables are treated as disabled.</td></tr><tr><td class=CDLEntry>disabled_char</td><td class=CDLDescription><span class="optional">optional</span> The character representing disabled data.&nbsp; The default character is a dash (&ldquo;-&rdquo;).</td></tr><tr><td class=CDLEntry>left_to_right</td><td class=CDLDescription><span class="optional">optional</span> If 1, the item at index 0 of the dynamic array is placed on the left of the output string.&nbsp; If 0, the item at index 0 of the data stream is placed on the right of the output string.&nbsp; The default is 1.</td></tr><tr><td class=CDLEntry>group</td><td class=CDLDescription><span class="optional">optional</span> The number of items put together in a group.&nbsp; If 0, no groups are created.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>group_separator</td><td class=CDLDescription><span class="optional">optional</span> A string to separate two groups if <b>group</b> is not 0.&nbsp; The default is a single space (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>num_head</td><td class=CDLDescription><span class="optional">optional</span> The number of first items in the data stream converted to a string.&nbsp; If specified, <b>ds[0]</b> to <b>ds[num_head-1]</b> are converted.&nbsp; If not specified (or -1), all items in the data stream are converted.</td></tr><tr><td class=CDLEntry>num_tail</td><td class=CDLDescription><span class="optional">optional</span> The number of last items in the data stream converted to a string.&nbsp; If specified, <b>ds[ds.size()-num_tail]</b> to <b>ds[ds.size()-1]</b> are converted.&nbsp; If not specified (or -1), all items in the data stream are converted.</td></tr><tr><td class=CDLEntry>abbrev</td><td class=CDLDescription><span class="optional">optional</span> A string to indicate the abbreviation of the items in the data stream.&nbsp; The <b>abbrev</b> is used only if all items are not converted to a string.&nbsp; The default is three periods followed by a space (&ldquo;...&nbsp; &ldquo;).</td></tr></table><h4 class=CHeading>Returns</h4><p>A string representing <b>ds</b> qualified with <b>enables</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">bit[7:0] ds8[] = new[10]( '{ 8'h10, 8'h11, 8'h12, 8'h13, 8'h14, 8'h15, 8'h16, 8'h17, 8'h18, 8'h19 } );
bit      en[]  = new[10]( '{ 1'b1,  1'b0,  1'b1,  1'b0,  1'b1,  1'b0,  1'b1,  1'b0,  1'b1,  1'b0  } );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en )
  == &quot;10--12--14--16--18--&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(1) )
  == &quot;10 -- 12 -- 14 -- 16 -- 18 --&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(2) )
  == &quot;10-- 12-- 14-- 16-- 18--&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(8) )
  == &quot;10--12--14--16-- 18--&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(1), .group_separator(&quot;|&quot;) )
  == &quot;10|--|12|--|14|--|16|--|18|--&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(1), .num_head(2), .num_tail(2) )
  == &quot;10 -- ...18 --&quot; );
assert( data_stream#(bit,8)::to_string_with_en( ds8, en, .group(1), .disabled_char(&quot;*&quot;) )
  == &quot;10 ** 12 ** 14 ** 16 ** 18 **&quot; );</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "colspan=5>virtual class data_stream #(</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> bit,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>WIDTH</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td>&nbsp;&nbsp;&nbsp;</td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>DEGREE</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 2</td></tr><tr><td class="PAfterParameters  prettyprint "colspan=5>) extends dynamic_array #( T[WIDTH-1:0] )</td></tr></table></td></tr></table></blockquote>A parameterized class that manages a stream of packed arrays.</div></div><div class=CToolTip id="tt2"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T [WIDTH-1:0] pa_type</td></tr></table></blockquote>The shorthand of the packed array of type <b>T</b>.</div></div><div class=CToolTip id="tt3"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef pa_type ds_type[]</td></tr></table></blockquote>The data stream type. </div></div><div class=CToolTip id="tt4"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef T bs_type[]</td></tr></table></blockquote>The bit stream type. </div></div><div class=CToolTip id="tt5"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>typedef scrambler#(</td><td class="PParameter  prettyprint " nowrap>T,</td></tr><tr><td></td><td class="PParameter  prettyprint " nowrap>DEGREE</td><td class="PAfterParameters  prettyprint "nowrap>)::lfsr_type lfsr_type</td></tr></table></td></tr></table></blockquote>The linear feedback shift register (LFSR) type. </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bs_type to_bit_stream(</td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>msb_first</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>from_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>to_index</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Serializes a data stream of type <b>T</b> to a bit stream of the same type.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type make_divisible(</td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>divisible_by</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>padding</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Makes the data stream divisible by the specified number by padding data.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type sequential(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>init_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>step</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>randomize_init_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a new data stream with the elements whose values are initialized with sequential values.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type constant(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>pa_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>randomize_value</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a new data stream with the elements whose values are initiazlized with the specified constant.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type random(</td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a new data stream with the elements whose values are randomized.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function ds_type scramble(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>scrambler#(T,DEGREE)&nbsp;</td><td class="PParameter  prettyprint " nowrap>scrblr,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>ref&nbsp;</td><td class="PType  prettyprint " nowrap>lfsr_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>lfsr,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>input&nbsp;</td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>msb_first</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a scrambled data stream.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>left_to_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>group</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>group_separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_head</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_tail</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>abbrev</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;... &quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a data stream to the form of a string.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string to_string_with_en(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>ds_type&nbsp;</td><td class="PParameter  prettyprint " nowrap>ds,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>enables[],</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>disabled_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;-&quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>left_to_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>group</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>group_separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_head</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>num_tail</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>abbrev</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;...&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Converts a data stream with corresponding data enables to the form of a string.</div></div><div class=CToolTip id="tt14"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>class scrambler #(</td><td class="PType  prettyprint " nowrap>type&nbsp;</td><td class="PParameter  prettyprint " nowrap>T</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> bit,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>DEGREE</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 2</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Provides a function to scramble an input bit stream using Galois LFSR, which is also known as the internal LFSR.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>